
#include "testcase.h"
#include "../combinatorio.h"

using namespace Tester;

class CombinatorioTest : public TestCase<CombinatorioTest> {
   public:
      CombinatorioTest() : TestCase<CombinatorioTest>("Test de la clase Combinatorio", __FILE__) {
         add("Constructor", &CombinatorioTest::constructor);
         add("Combinatorio de n=0", &CombinatorioTest::combinatorioNulo);
      }

      void constructor() {
         Combinatorio d(3);

         assertTrue(d(0) == 1, __LINE__);
         assertTrue(d(1) == 3, __LINE__);
         assertTrue(d(2) == 3, __LINE__);
         assertTrue(d(3) == 1, __LINE__);

         Combinatorio c(5);

         assertTrue(c(0) == 1, __LINE__);
         assertTrue(c(1) == 5, __LINE__);
         assertTrue(c(2) == 10, __LINE__);
         assertTrue(c(3) == 10, __LINE__);
         assertTrue(c(4) == 5, __LINE__);
         assertTrue(c(5) == 1, __LINE__);
      }

      void combinatorioNulo() {
         Combinatorio c(0);

         assertTrue(c(0) == 1, __LINE__);
      }


};

namespace {
   CombinatorioTest test;
}

